package com.gridpower.spreadsheet.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.gridpower.spreadsheet.client.models.GridCell;
import com.gridpower.spreadsheet.client.models.AppModel.RemoteFileInfo;

public interface FileService extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static FileServiceAsync instance;
		public static FileServiceAsync getInstance(){
			if (instance == null) {
				instance = (FileServiceAsync) GWT.create(FileService.class);
				ServiceDefTarget target = (ServiceDefTarget) instance;
				target.setServiceEntryPoint(GWT.getModuleBaseURL() + "FileService");
			}
			return instance;
		}
	}
	public RemoteFileInfo getFileInfo(int id, String fileName);
	public GridCell[] getAllCellsForDoc(int docId);
}
